package ru.sushka.lunch.enitiy;

/**
 * 07.10.12 : 17:52
 * User: sushka
 */
public class Course implements Persistentce {
    //категории блюд: первое, второе, десерт, гарнир
    public static final int FIRST_COURSE   = 1;
    public static final int SECOND_COURSE  = 2;
    public static final int DESSERT        = 3;
    public static final int SIDE_DISH      = 4;
    public static final int DRINK          = 5;
    public static final int SNACK          = 6;

    private int id;
    private String name;
    private double price;
    private int category;
    private String consist;
    private boolean countable;
    
    public String getConsist() {
        return consist;
    }

    public void setConsist(String consist) {
        this.consist = consist;
    }

    public Course(String name, double price, int category, String consist, boolean countable) {
        this.id = 0;
        this.name = name;
        this.price = price;
        this.category = category;
        this.consist = consist;
        this.countable = countable;
    }

    public Course() {

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category = category;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    
    public String getCategoryName(){
        switch (category) {
        case 1:
            return  "Первое";
        case 2:
            return  "Второе";
        case 3:
            return  "Десерт";
        case 4:
            return  "Гарнир";
        case 5:
            return  "Напиток";
        case 6:
            return  "Закуска";
        default:
            return "";
        }
    }
  
    @Override
    public String toString() {
        return "Course [id=" + id + ", name=" + name + ", price=" + price
                + ", category=" + category + ", consist=" + consist + "]";
    }

    public boolean isCountable() {
        return countable;
    }

    public void setCountable(boolean countable) {
        this.countable = countable;
    }

}
